package cn.tedu._053mvcweibo.pojo.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * 注册功能:DTO
 */
@Data
public class UserRegDTO {
    //ApiModelProperty注解：在Knife4j页面中显示参数描述,是否必须,以及示例值
    @ApiModelProperty(value = "用户名", required = true, example = "Tony")
    /**
     * NotNull注解：不允许为空值NULL
     * NotEmpty注解：不允许为空字符串,也不允许为NULL
     * NotBlank注解：不允许为空白,也不允许为空字符串,也不允许为NULL
     * Size注解：限定字符串长度,闭区间(min和max的值都是包含的)
     */
    //@NotNull(message = "用户名不能为NULL")
    //@NotEmpty(message = "用户名不能为空")
    //@NotBlank(message = "用户名不能为空")
    @Size(min = 6, max = 12, message = "用户名必须在6-12位之间")
    private String username;
    @ApiModelProperty(value = "密码", required = true, example = "123456")
    private String password;
    @ApiModelProperty(value = "昵称", required = true, example = "tony")
    private String nickname;
}






